package book;

/**
 * @Author: 彪哥
 * @Create: 2025/1/16 - 13:03
 * @Version: v1.0
 * <p>
 * Description:TODO
 */
public class BookList {
    private Book [] books = new Book[10] ;
    private int usedSize ;  //存储当前书的个数

    /*
    事先通过构造方法 初始化的时候 给数组存三本书
     */
    public BookList () {
        books[0] = new Book("三国演义","罗贯中",89,"小说");
        books[1] = new Book("西游记","吴承恩",78,"小说");
        books[2] = new Book("红楼梦","曹雪芹",49,"小说");
        this.usedSize = 3 ;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    public Book getPos(int pos){
        return books[pos];
    }
}
